<template>
    <CommonContainer title="采购信息">
        <el-descriptions v-if="customerInfo">
            <el-descriptions-item label="采购编号" v-if="customerInfo.carBasicVo"><span class="goorder" @click="gopurchase(customerInfo.carBasicVo.purchaseOrderId,customerInfo.carBasicVo.purchaseType)">{{ customerInfo.carBasicVo.purchaseNo|filterNull }}</span></el-descriptions-item>
            <el-descriptions-item label="供应商名称" v-if="customerInfo.carBasicVo">{{ customerInfo.carBasicVo.supplierName|filterNull }}</el-descriptions-item>
            <el-descriptions-item label="新车/旧车" v-if="customerInfo.carBasicVo">
                {{ customerInfo.carBasicVo.carClassification=='1'?'新车':'旧车'|filterNull }}
            </el-descriptions-item>
            <el-descriptions-item label="采购单价" v-if="customerInfo.carBasicVo">
                {{ customerInfo.carBasicVo.purchasePrice|filterNull }}
            </el-descriptions-item>
            <el-descriptions-item label="指导价" v-if="customerInfo.carBasicVo">
                {{ customerInfo.carBasicVo.guidancePrice|filterNull }}
            </el-descriptions-item>
            <el-descriptions-item label="采购类型" v-if="customerInfo.carBasicVo">{{ customerInfo.carBasicVo.purchaseType|filterNull }}</el-descriptions-item>
        </el-descriptions>
    </CommonContainer>
</template>

<script>
export default {
    components: {},
    dicts:['business_type','customer_level','customer_label'],
    props: {
        value: {
        type: Object,
        },
    },
    data() {
        return {}
    },
    computed:{
        customerInfo: {
            get() {
                return this.value;
                return this.useVModel.call(this);
            },
            set(val) {
                this.$emit("input", val);
            }, 
        },
    },
    methods: {
        gopurchase(id,type){
            if (2 == type) {
                //订单
                this._toPage({
                    name: "OrderPurchase",
                    query: {
                        purchaseOrderId: id,
                        type: "detail",
                        pageType: "订单采购详情",
                    },
                });
            } else {
                this._toPage({
                    name: "PurchaseAdd",
                    query: {
                        purchaseOrderId: id,
                        type: "detail",
                        pageType: "采购详情",
                    },
                });
            }
        },
    },
    mounted() {
    },

}
</script>

<style lang="scss" scoped>
.goorder{
    color:blue;
    cursor: pointer;
}
</style>
